<%@page language="java" pageEncoding="UTF-8" %>
<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.gfa4j.util.CommonUtils"%>
<%@page import="com.gfa4j.wef.utils.CollectionHelper"%>
<%@page import="com.wef.system.entity.domain.MenuGroupDomain"%>
<%@page import="com.wef.system.entity.domain.MenuItemDomain"%>
<%@page import="com.wef.common.service.UserInfo"%>
<%@page import="com.wef.system.service.impl.LoginServiceImpl"%>
<%@include file="/pages/common/meta.jsp"  %>
<%@include file="/pages/common/taglib.jsp"  %>
<%
Map modules = (Map)UserInfo.getInstance().getUserModules();
%>
<script type="text/javascript">
var subModelMenu;
subModelMenu = new SDMenu("divMenu");
subModelMenu.oneSmOnly = true;
subModelMenu.speed = 10;
subModelMenu.init();

hiddenModel();
</script>
<div class="ModuleLeft ui-widget-content" id="ModuleLeft">
	<div class="ModuleLeftBox">
		<div class="ModuleLeftList">
			<div id="divMenu" class="sdmenu">
				<% 
				for (Iterator iterator = modules.keySet().iterator(); iterator.hasNext();) {
					Module module = (Module) modules.get(iterator.next());
					if(!CommonUtils.isEmpty(module)&&!module.getModuleCode().equals("system")){
						List lstMenuGroup = new ArrayList(module.getMenuGroups());
						CollectionHelper.sortList(lstMenuGroup, MenuGroupDomain.menuGrpSeq);
						for (Iterator itMG = lstMenuGroup.iterator();itMG.hasNext();) {
							MenuGroup menuGroup = (MenuGroup)itMG.next();
						%>
						<div class="collapsed ui-state-default">
							<span><%=LoginServiceImpl.getInternationalInfo(menuGroup)%></span>
							<%
								List lstMenuItems = new ArrayList(menuGroup.getMenuItems());
								CollectionHelper.sortList(lstMenuItems, MenuItemDomain.menuItemSeq);
								for (Iterator itMI = lstMenuItems.iterator();itMI.hasNext();) {
									MenuItem menuItem = (MenuItem)itMI.next();
									String title = LoginServiceImpl.getInternationalInfo(menuItem);
								%>
								<a class="<%=menuItem.getClassName() %>" href="javascript:void(0);" onclick="TabTagUtils.newTab('<%= menuItem.getViewId() %>','<%= title %>','${ctx}/<%= menuItem.getMenuItemUrl() %>');"><%= title %></a>
								<% } %>
						</div>
				<% }}} %>
			</div>
		</div>
	</div>
</div>